import { baseUrl } from "@/config/env";

export default {
    data(){
        return {
            refleshEditor: true,
            config: {
                height: 260,
                width: 575,
                toolbar :
                [
                    //加粗     斜体，     下划线      穿过线      下标字        上标字
                   ['Bold','Italic','Underline','Strike','Subscript','Superscript'],
                    // 数字列表          实体列表            减小缩进    增大缩进
                   ['NumberedList','BulletedList','-','Outdent','Indent'],
                    //左对齐             居中对齐          右对齐          两端对齐
                   ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
                    //  水平线            表情       特殊字符        分页符
                   [ 'HorizontalRule','Smiley','SpecialChar','PageBreak'],
                    // 样式       格式      字体    字体大小
                   ['Styles','Format','Font','FontSize'],
                    //文本颜色     背景颜色
                   ['TextColor','BGColor'],
                ],
                // toolbar: [
                //     ['Styles', 'Format'],
                // ],
                // fontDefaultLabel: "'黑体', 'Microsoft Yahei', Helvetica, Arial, sans-serif",
                // filebrowserBrowseUrl: '/apps/ckfinder/3.4.5/ckfinder.html',
                // filebrowserImageBrowseUrl: '/apps/ckfinder/3.4.5/ckfinder.html?type=Images',
                // filebrowserUploadUrl: baseUrl + '/admin/file/ckeditorUpload?command=QuickUpload&type=Files',
                // filebrowserImageUploadUrl: baseUrl + '/admin/file/ckeditorUpload?command=QuickUpload&type=Images', // 弹框 上传图片
                filebrowserUploadUrl: baseUrl + '/admin/file/ckeditorUpload?command=QuickUpload&type=Files',
                filebrowserImageUploadUrl: baseUrl + 'api/fileUpload?command=QuickUpload&type=Files', // 弹框 上传图片
                // extraPlugins: 'codesnippet',
            },
        }
    },

    created() {
        this.$nextTick(()=>{

        })
    },

    activated(){
        this.$nextTick(()=>{
            //this.init();
            this.refleshEditor = false;
            setTimeout(()=>{
                this.refleshEditor = true;
            }, 0)
        })
    },

    methods: {
        onBlur(evt) {
            console.log(evt);
        },
        onFocus(evt) {
            console.log(evt);
        },
        onContentDom(evt) {
            console.log(evt);
        },
        onDialogDefinition(evt) {
            console.log(evt);
        },
        onFileUploadRequest(evt) {
            console.log(evt);
        },
        onFileUploadResponse(evt) {
            console.log(evt);
        }
    }
}
